package com.cxf.client;



import com.cxf.server.service.User;
import com.cxf.server.service.impl.IUserService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

/**
 * 摘要:测试类
 *
 * @author xyt
 * @create 2016-12-10 14:36
 **/

public class UserWSClientTest {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext(
                new String[] { "client-bean.xml" });
        IUserService userService = (IUserService) classPathXmlApplicationContext
                .getBean("userClient");
        User user = userService.getUserById(1000);
        System.out.println(user.getId());
        System.out.println(user.getName());
        System.out.println(user.getAge());
        System.out.println("-------------------");
        List<User> allUsers = userService.getAllUsers();
        for (User u : allUsers) {
            System.out.println(u.getId());
            System.out.println(u.getName());
            System.out.println(u.getAge());
            System.out.println("-------------------");
        }
    }
}
